import type { GetUserInfoResponse, LoginResponse } from "./model/loginModel";
import request from "@/utils/request";
enum Api {
  GetLoginUrl = `/admin/acl/index/login`,
  GetLoginInfoUrl = `/admin/acl/index/info`,
  GetLogoutUrl = `/admin/acl/index/logout`,
}
/**
 * 登录
 * @param username
 * @param password
 * @returns
 */
export const GetLoginApi = (username: string, password: string) => {
  return request.post<any, LoginResponse>(Api.GetLoginUrl, {
    username,
    password,
  });
};
/**
 * 获取用户数据
 * @returns
 */
export const GetLoginInfoApi = () => {
  return request.get<any, GetUserInfoResponse>(Api.GetLoginInfoUrl);
};
/**
 * 退出登录
 * @returns
 */
export const GetLogoutApi = () => {
  return request.post<any, null>(Api.GetLogoutUrl);
};
